package cn.itcast.bos.base.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.base.Courier;
import cn.itcast.bos.domain.base.Standard;

public interface CourierDao extends JpaRepository<Courier, Integer>,JpaSpecificationExecutor<Courier>{

	//方法一
	public Standard findByName(String name);
	
	//方法二
	@Query(value="from Standard")
	public List<Standard> query();
	
	@Query(value="update Courier c  set c.deltag=1 where id=?")
	@Modifying
	public void deleteCourier(Integer integer);
	
	@Query(value="update Courier c  set c.deltag=null where id=?")
	@Modifying
	public void RestoreCourier(Integer integer);
}
